package com.em.frame.utils;



import java.util.Map;
import java.util.WeakHashMap;

import static com.em.common.Constant.*;

/**
 * Created by zlx on 2017/11/24 0024.
 */
public class ResponseUtil {

    public static Object SUCCESS(){
        Map<String, Object> result = new WeakHashMap<String, Object>();
        result.put(_CODE,SUCCESS_CODE);
        result.put(_BODY,"success");
        return  result;
    }

    public static Object SUCCESS(Object data){
        Map<String, Object> result = new WeakHashMap<String, Object>();
        result.put(_CODE,SUCCESS_CODE);
        result.put(_BODY,data);
        return  result;
    }


    public static Object ERROR(String msg){
        Map<String, Object> result = new WeakHashMap<String, Object>();
        result.put(_CODE,ERROR_CODE);
        result.put(_REEOR,msg);
        return  result;
    }
}
